﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UI.Forms
{
    public partial class 收付款方式_N : FormBase1
    {
        public delegate void DoAction();//如果有参数的话，定义参数 

        public DoAction FatherRefresh;
        int count = 0;
        public 收付款方式_N()
        {
            InitializeComponent();
        }

        private void CRM_Area_Load(object sender, EventArgs e)
        {
            

        }

        private void btn_new_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (dxValidationProvider1.Validate())
            {
                SVC.client.ZFTYPE zt = new SVC.client.ZFTYPE();
                zt.typename = te_Name.Text.Trim();

                string r = my.bw.ZFTYPE_Add(zt, my.ACID);
                if (string.IsNullOrEmpty(r))
                {
                    count++;
                    resetui();
                }
                else
                {
                    Comm.ShowErorr(r);
                }
            }
        }

        private void resetui()
        {
            te_Name.Text = "";
        }





        private void 收付款方式_N_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (count>0)
            {
                FatherRefresh();
            }
        }
    }
}